package com.eascs.ticket.schedule.controller;

import javax.inject.Inject;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.eascs.site.controller.BaseRestController;
import com.eascs.site.view.BaseRestResult;
import com.eascs.ticket.schedule.scheduler.ScheduleTicketScheduler;
import com.eascs.ticket.schedule.scheduler.WarnTicketListEmailScheduler;
import com.eascs.ticket.user.interceptor.SuperAdministrator;

@RestController
@SuperAdministrator
public class ScheduleRestController extends BaseRestController {

	@Inject
	private WarnTicketListEmailScheduler warnTicketListEmailScheduler;

	@Inject
	private ScheduleTicketScheduler scheduleTicketScheduler;

	@RequestMapping("/schedule/rest/warnTicketListEmail")
	public BaseRestResult<Object> warnTicketListEmail() {
		warnTicketListEmailScheduler.warnTicketListEmail();
		return BaseRestResult.buildRestResult("OK");
	}

	@RequestMapping("/schedule/rest/buildTickect")
	public BaseRestResult<Object> buildTickect() {
		scheduleTicketScheduler.buildTickect();
		return BaseRestResult.buildRestResult("OK");
	}

}
